package com.wn.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import com.wn.util.ResultVO;

/**
 * @program: manager
 * @ClassName GlobalExceptionHandler
 * @description:
 * @author: 韩旭
 * @create: 2023-02-04 14:33
 **/
@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ResultVO handleException(Exception e) {
        // for debug
        e.printStackTrace();
        return ResultVO.failure(e.toString());
    }
}